/**
 * 
 */
package org.cnbi.entity;
import java.io.Serializable;
import java.util.List;

import org.cnbi.utils.pojo.indicator.IndicatorParamsBean;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
 * Copyright © 2014中国经邦. All rights reserved.
 * 
 * @author 龚佳新
 * @date 2014年5月7日下午6:13:05
 * @cnbi-utils
 * 
 *             查询表达式 SELECT nid as id, sname as name , sexpression as exp ,npid
 *             as pid FROM RPT_Expression where cisfolder='N' 表达式的参数 SELECT
 *             expid as id,sparameter as name, sfunction as exp FROM
 *             RPT_Indicator where expid =:scode
 *             模拟对应数据库指标表
 */
public class IndicatorExpression implements Serializable,Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
	private int id;
	
	/**
	 * 指标名称
	 */
	@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
	private String name;
   
	
	/**
	 * 父亲节点
	 */
	private int pid;

	
	/**
	 * 所属类别  其实不用加的
	 */
	private String c;
	
	
   /**
    * 是否为孩子节点
    */
	private int isLeaf;
	
	/**
	 * 文字表达式
	 */
	@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
	private String exp;
	/**
	 * 计算表达式
	 */
	@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
	private String fun;
     /**
      * 计算后的结果
      */
	private double datas;
	
	/**
	 * 孩子集合
	 */
	@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
	private List<IndicatorExpression> children;
    /**
     * 参数集合
     */
	@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
	private List<IndicatorParamsBean> params;

    /**
      * 行业参数Id
    */
	private String indcode;
	
	
	public IndicatorExpression() {
	}

	public IndicatorExpression(int id) {
		this.id = id;
	}

	public IndicatorExpression(String name) {
		this.name = name;
	}

	
	/**
	 * @return the children
	 */
	public List<IndicatorExpression> getChildren() {
		return children;
	}

	/**
	 * @param children
	 *            the children to set
	 */
	public void setChildren(List<IndicatorExpression> children) {
		this.children = children;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the pid
	 */
	public int getPid() {
		return pid;
	}

	/**
	 * @param pid
	 *            the pid to set
	 */
	public void setPid(int pid) {
		this.pid = pid;
	}

	/**
	 * @return the isLeaf
	 */
	public int getIsLeaf() {
		return isLeaf;
	}

	/**
	 * @param isLeaf
	 *            the isLeaf to set
	 */
	public void setIsLeaf(int isLeaf) {
		this.isLeaf = isLeaf;
	}

	/**
	 * @return the exp
	 */
	public String getExp() {
		return exp;
	}

	/**
	 * @param exp
	 *            the exp to set
	 */
	public void setExp(String exp) {
		this.exp = exp;
	}

	/**
	 * @return the params
	 */
	public List<IndicatorParamsBean> getParams() {
		return params;
	}

	/**
	 * @param params
	 *            the params to set
	 */
	public void setParams(List<IndicatorParamsBean> params) {
		this.params = params;
	}

	/**
	 * @return the c
	 */
	public String getC() {
		return c;
	}

	/**
	 * @param c
	 *            the c to set
	 */
	public void setC(String c) {
		this.c = c;
	}

	/**
	 * @return the datas
	 */
	public double getDatas() {
		return datas;
	}

	/**
	 * @param datas
	 *            the datas to set
	 */
	public void setDatas(double datas) {
		this.datas = datas;
	}

	

	/* 
	 * @data 2014年5月28日  复写的方法
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "IndicatorExpression [id=" + id + ", name=" + name + ", pid=" + pid + ", c=" + c + ", isLeaf=" + isLeaf + ", exp=" + exp + ", fun=" + fun + ", datas=" + datas + ", children=" + children + ", params=" + params + ", indcode=" + indcode+ "]";
	}

	public IndicatorExpression clones() {
		IndicatorExpression indicatorBean = null;
		try {
			indicatorBean = (IndicatorExpression) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return indicatorBean;
	}

	/*
	 * @data 2014年5月12日 复写的方法
	 * 
	 * @see java.lang.Object#clone()
	 */
	@Override
	public Object clone() {
		IndicatorExpression indicatorBean = null;
		try {
			indicatorBean = (IndicatorExpression) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return indicatorBean;
	}

	/**
	 * @return the fun
	 */
	public String getFun() {
		return fun;
	}

	/**
	 * @param fun the fun to set
	 */
	public void setFun(String fun) {
		this.fun = fun;
	}

	/**
	 * @return the indcode
	 */
	public String getIndcode() {
		return indcode;
	}

	/**
	 * @param indcode the indcode to set
	 */
	public void setIndcode(String indcode) {
		this.indcode = indcode;
	}

	
	
	 

}
